<template>
  <el-dialog
  title="点位详情"
  :visible="dialogTableVisible"
  @open='openFn'
  @close='closeFn'
  style="text-align:left"

  >
  <el-table
   :header-cell-style="{
        background: '#f4f6fa',
        color: '#666666',
        height: '44px',
      }"
      :data="DetailList"
>
  <el-table-column label="序号" width="80" type="index"></el-table-column>
    <el-table-column property="innerCode" label="机器编号" ></el-table-column>
    <el-table-column property="name" label="设备状态">
        <template v-slot='{row}'>
            {{row.vmStatus === 0?'未投放':row.vmStatus === 1?'运营':row.vmStatus === 3?'运营':''}}
        </template>
    </el-table-column>
    <el-table-column  label="最后一次供货时间">
       <template v-slot='{row}'>
         {{row.lastSupplyTime | getNowTime}}
       </template>
    </el-table-column>
  </el-table>
</el-dialog>
</template>

<script>
import { detailList } from '@/api/point'
import { getNowTime } from '@/views/Point/index'
export default {
  props: {
    dialogTableVisible: Boolean,
    row: {
      type: Object,
      default: () => {}
    }
  },
  data () {
    return {
      DetailList: []
    }
  },
  methods: {
    closeFn () {
      this.$emit('update:dialogTableVisible', false)
    },
    async openFn () {
    //   console.log(this.row)
      const res = await detailList(this.row.id)
      console.log(res)
      this.DetailList = res
    }
  },
  filters: {
    getNowTime
  }
}
</script>

<style lang="less" scoped>

/deep/ .el-dialog {
    width: 630px;
    text-align: left;
    font-weight: 700;
    font-size: 16px;
    border-radius: 15px;
}
/deep/ .el-dialog__body {
    padding: 0px 20px;
}

</style>
